package main;

import javax.swing.JFrame;
import javax.swing.SwingUtilities;

//Nikolas Wolfe
//3/18/09
//CIS 4930
//Game Of Life

//This starts the Game of Life

public class GameOfLifeDriver
{
	public static void main( String[] args )
	{
		// happens asynchronously after pending AWT events complete
		SwingUtilities.invokeLater( new Runnable()
		{
			public void run()
			{
				createAndDisplayGameOfLife();
			}
		});
	}
	
	private static void createAndDisplayGameOfLife()
	{
		// create the Game of Life grid
		PaneOfLife paneOfLife = new PaneOfLife();
		paneOfLife.initialize();
		
		// create the frame to hold it
		FrameOfLife frameOfLife = new FrameOfLife( paneOfLife );
		frameOfLife.initialize();
		frameOfLife.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
		
		// layout and display
		frameOfLife.pack();
		frameOfLife.setVisible( true );
	}
}
